//
//  CYImageScrollView.m
//  CreditAddressBook
//
//  Created by Lee on 15/8/11.
//  Copyright (c) 2015年 Lee. All rights reserved.
//  我的通缉详情中多张图片显示

#import "CYImageScrollView.h"
#import "UIImageView+WebCache.h"
#import "CYURL.h"

@interface CYImageScrollView ()


@end

@implementation CYImageScrollView

- (void)setImageUrls:(NSArray *)imageUrls {
    CGFloat margin = 10;
    CGFloat height = self.height - 2 * margin;
    CGFloat x = margin + 8;
    for (NSString *url in imageUrls) {
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(x, margin, height, height)];
        [imageView sd_setImageWithURL:CYURLWithService(url) placeholderImage:[UIImage imageWithName:@"putao_icon_quick_replace_s"]];
        imageView.contentMode = UIViewContentModeScaleAspectFit;
        [self addSubview:imageView];
        x += margin + height;
    }
    self.contentSize = CGSizeMake(x, 0);
}
@end
